

set more off
mat drop _all












use "$path_data/data/temp/attrition_check.dta", clear










rename DT_time_pre DT_time_bl
rename DT_time_post DT_time_el







*** Comparison over distribution for checking the heterogeneity in the treatment effects on non-cognitive ability

* In order to have the treatment line first, I make the reversed dummy of the treatment status
gen treatment_reverse = 1 - treatment




*** Difference in NonCog
* Low initial PTSII-C and Low initial RSPS

sum DT_time_bl if wrongDT == 0 & treatment_reverse != . & DT_time_el != .
local nn : display %4.0f = r(N)
display `nn'


distplot DT_time_bl if wrongDT == 0 & DT_time_el != ., over(treatment_reverse) ///
title(DT Time at Baseline) ///
xlabel(0 5 10 15 20) xtitle("DT Time at Baseline") ytitle("Cumulative Density") ///
legend(order(1 "Treatment" 2 "Control") pos(11) ring(0) ///
col(1) si(small) rowgap(0.2)) graphregion(color(white)) plotregion(fcolor(white)) graphregion(margin(medlarge)) ///
ylabel(,angle(0)) lp(solid dash) lc(black black)
graph export "$pardir/figureB1.pdf", replace as(pdf)



sum DT_time_el if wrongDT == 0 & treatment_reverse != . & DT_time_bl != .
local nn : display %4.0f = r(N)
display `nn'


distplot DT_time_el if wrongDT == 0 & DT_time_bl != ., over(treatment_reverse) ///
title(DT Time at Endline) ///
xlabel(0 5 10 15 20) xtitle("DT Time at Endline") ytitle("Cumulative Density") ///
legend(order(1 "Treatment" 2 "Control") pos(11) ring(0) ///
col(1) si(small) rowgap(0.2)) graphregion(color(white)) plotregion(fcolor(white)) graphregion(margin(medlarge)) ///
ylabel(,angle(0)) lp(solid dash) lc(black black)
graph export "$pardir/figureB2.pdf", replace as(pdf)


